#include<iostream>
#include<windows.h>
#include<stdlib.h>
using namespace std;

const int N=5000;
double a[N],sum=0.0;

void init()
{
    for(int i=0;i<N;i++)
    {
        a[i]=i;
    }

}
//superscalar
int main()
{
    long long head, tail , freq ; // timers
    init ();
    // similar to CLOCKS_PER_SEC
    QueryPerformanceFrequency((LARGE_INTEGER *)&freq );
    // start time
    QueryPerformanceCounter((LARGE_INTEGER *)&head);
        double sum1=0.0,sum2=0.0;
for(int n=0;n<10;n++)
{

        sum1=0.0;
        sum2=0.0;
       for(int i=0;i<N;i+=2)
        {
            sum1+=a[i];
            sum2+=a[i+1];
        }
        sum=sum1+sum2;
}
    // end time
    QueryPerformanceCounter((LARGE_INTEGER *)&tail );
    cout<<"Time:" << ((tail- head) * 1.0 )/ freq << "s" << endl;


    system("pause");
    return 0;
}

